package com.cong.outlets.service;

import com.cong.outlets.dto.OutletsLensDto;
import com.cong.outlets.entity.Lens;
import com.cong.outlets.entity.Outlets;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author cong
 * @since 2023/10/20 14:11
 */
@Service
public class OutletsService {

    @Autowired
    private LensService lensService;

    public OutletsLensDto getById(Long outletsId) {
        Outlets outlets = Outlets.builder().id(outletsId).name("网点1").build();
        List<Lens> lensList = lensService.getListByOutletsId(outletsId);

        OutletsLensDto outletsLensDto = new OutletsLensDto();
        outletsLensDto.setOutlets(outlets);
        outletsLensDto.setLensList(lensList);
        return outletsLensDto;
    }
}
